#include "Screen.h"
#include <iostream>
#include "Snake.h"
#include "Food.h"	
using namespace std;
extern int width;
extern int height;

Screen::Screen()
{

}

bool Screen::screenFlush(Snake& snake, Food& food)
{
	int retMove = snake.move(&food);
	for (int n = 0; n < width; n++)
	{
		for (int m = 0; m < height; m++)
		{
			if (snake.isSnakeHead(Pos(n, m)))
				cout << " @";
			else if (n == 0 || n == width - 1 || m == 0 || m == height - 1)
				cout << " #";
			else if (snake.isSnakeBody(Pos(n, m)))
				cout << " +";
			else if (food.isFood(Pos(n, m)))
				cout << " *";
			else
				cout << "  ";
		}
		cout << endl;
	}
	if (0 == retMove) return false;
	return true;
}
